package com.zhuzi.utils;

import java.util.Objects;
import java.util.concurrent.TimeUnit;

/**
 * @author zhuzi
 * 2022/8/18 08:06
 */
public class SleepUtils {
    public static void sleep(int time, TimeUnit timeUnit) {
        if (Objects.isNull(timeUnit)) {
            timeUnit = TimeUnit.SECONDS;
        }
        try {
            timeUnit.sleep(time);
        } catch (InterruptedException e) {
        }
    }
}
